/**
 * @author caif
 * @fileoverview folder viewer
 * @extends file viewer
 */
App.Views.folderView = App.Views.itemView.extend({
	template   : tpl.folder,
	
	className : "doc-item list-item folder-item",
	
	events: {
		"keyup .edit"           : "updateOnEnter",
	    "blur .edit"            : "close",
	    "click .inner-item"        : "updateDetail",
	    "dblclick .inner-item"     : "open"
	},
	
	initialize : function() {
		var self = this;
		self.constructor.__super__.initialize.apply(self);
		self.model.bind('change', self.render, self);
	},
	
	render: function(){
		var self = this;
		self.model.set({
            uiSize: '',
            uiExtension: App.i18n.get('folder'),
            uiUpdateTime: self.getLocaleDate(self.model.get('updateTime')),
            rootPath: App.viewInstances.appView.getRootPath()
		}, {silent: true});
        self.$el.html( Mustache.to_html(self.template, self.model.toJSON()));
        self.input = self.$('.edit');
        return self;
	}
});
